import { createStore, applyMiddleware } from "redux";//创建仓库，引入中间件
import combineReducers from "./combineReducers";// 引入汇总后的reducer
import createSagaMiddleware from "redux-saga";
import rootSaga from "./rootSaga";

const saga =createSagaMiddleware()//创建一个saga的对象
const store =createStore(combineReducers,applyMiddleware(saga))// 调用所有的saga使其生效
saga.run(rootSaga)//调用汇总的saga

export default store